<template>
	<view class="cell-page">
		<template v-if="userInfo.roleCategoryId===3 || userInfo.roleCategoryId === 5">
			<!-- <view class="grid-box">
				<u-grid :border="false" col="5" >
					<u-grid-item v-for="(listItem,listIndex) in financeList" :key="listIndex" @click="$u.route(listItem.route)">
						<view class="icon">
							<uni-icons custom-prefix="iconfont" :type="listItem.icon" color="#fff" size="24"/>
						</view>
						<text class="fsize-24">{{listItem.title}}</text>
					</u-grid-item>
				</u-grid>
			</view> -->
			<view class="">
				<view class="padding-20 line-gray fsize-26">运营者中心</view>
				<view class="">
					<my-cell-group title="品牌联创" label="让消费者变成参与者" icon="icon-dianpu" url="/pages/app/share" />
					<my-cell-group v-if="store.mainStore===1" title="毛利设置" label="项目 卡项 商品毛利设置" icon="icon-Grossmargin" url="/pages/grossProfit/menus?type=1" />
				</view>
			</view>
			<view class="" v-if="store.mainStore===1">
				<view class="padding-20 line-gray fsize-26">店务管理</view>
				<view class="">
					<my-cell-group title="新店申请" label="生成新店铺分享码" icon="icon-dianpu" url="/pages/manageStores/index" />
					<my-cell-group title="门店管理" label="门店资料修改" icon="icon-shop08" url="/pages/shop/default/index" />
					<my-cell-group title="部门管理" label="部门新增及修改" icon="icon-bumenguanli" url="/pages/department/index" />
					<my-cell-group title="管理员等级" label="管理者业绩提成方案" icon="icon-bumenguanli" url="/pages/customer/adminPerformance" />
					<my-cell-group title="保证金列表" label="增减门店保证金" icon="icon-filter" url="/pages/shop/default/margin-list" />
					<my-cell-group title="会员分类" label="新增编辑会员分类" icon="icon-fenlei-" url="/pages/customer/categoryList" />
					<my-cell-group title="会员等级" label="新增编辑会员等级" icon="icon-huiyuandengji" url="/pages/customer/userGradeList" />
					<my-cell-group title="员工等级" label="新增编辑员工等级" icon="icon-grade" url="/pages/customer/staffList" />
				</view>
			</view>
			<view class="" v-if="store.mainStore===1">
				<view class="pb-20 pt-10 pl-20 line-gray fsize-26">项目管理</view>
				<view class="">
					<my-cell-group title="项目列表" label="项目新增及修改" icon="icon-xiangmu" url="/pages/project/project/list" />
					<my-cell-group title="卡项列表" label="卡项新增及修改" icon="icon-a-37-kapian" url="/pages/project/card/list" />
					<my-cell-group title="项目分类" label="项目分类的新增及修改" icon="icon-fenlei-" url="/pages/project/category/list" />
				</view>
				<!-- <view class="pb-20 pt-10 pl-20 line-gray fsize-26">商品管理</view>
				<view class="">
					<my-cell-group title="商品列表" label="商品新增及修改" icon="icon-xiangmu" url="/pages/project/product/list" />
					<my-cell-group title="商品分类" label="商品分类的新增及修改" icon="icon-a-37-kapian" url="/pages/project/product/classify" />
					<my-cell-group title="品牌列表" label="商品品牌的新增及修改" icon="icon-fenlei-" url="/pages/project/product/brand" />
				</view> -->
			</view>
			<view>
				<view class="pb-20 pt-10 pl-20 line-gray fsize-26">财务数据</view>
				<my-cell-group 
					v-for="(listItem,listIndex) in financeList" 
					:key="listIndex" 
					:title="listItem.title" 
					:icon="listItem.icon" 
					:url="listItem.route" 
				/>
			</view>
		</template>
		<template v-if="userInfo.roleCategoryId===2">
			<my-cell-group title="项目分享" label="分享门店项目给好友" icon="icon-project-sharing" url="/pages/project/project/list" />
			<my-cell-group title="商品分享" label="分享门店商品给好友" icon="icon-product-sharing" url="/pages/project/product/list" />
			<my-cell-group title="卡项分享" label="分享门店卡项给好友" icon="icon-xiangmutuijian" url="/pages/project/card/list" />
			<my-cell-group 
				title="联创推荐" 
				label="推荐联创入伙,获得其利润的分红" 
				icon="icon-share" 
				url="/pages/shop/Shareholder/edit?type=3"
			/>
		</template>
		<template v-if="userInfo.roleCategoryId===4">
			<my-cell-group 
				title="结算记录" 
				label="我的提成结算记录" 
				icon="icon-jiesuan" 
				:url="`/pages/finance/settlementList?id=${userInfo.userId}&userName=${userInfo.userName}`" 
			/>
			<my-cell-group 
				title="排班管理" 
				label="管理项目预约时间排班" 
				icon="icon-classes" 
				url="/pages/shop/Staff/workshiftList" 
			/>
			<my-cell-group 
				title="可服务项目" 
				label="设置我可以服务的项目" 
				icon="icon-project-sharing" 
				url="/pages/shop/Staff/serviceList" />
			<!-- <my-cell-group title="员工合伙" label="员工合伙体系(联系管家开通)" icon="icon-chengxinhezuowoshou" url="" /> -->
			<my-cell-group
				title="业绩" 
				label="查看相关业绩" 
				icon="icon-yejiguanli" 
				url="/pages/finance/achievementList" />
		</template>
	</view>
</template>

<script>
	import myCellGroup from '@/components/my-cell-group/index.vue'
	import { mapState } from 'vuex'
	export default {
		components:{ myCellGroup },
		data() {
			return {
				financeList:[
					{ title:'财务概况', icon:'icon-tubiao_caiwutongji', route:'/pages/finance/index' },
					{ title:'员工排行', icon:'icon-yuangongguanli1', route:'/pages/finance/staffRankingList' },
					{ title:'品项分析', icon:'icon-xiangmuguanli-', route:'/pages/finance/projectAnalysis' },
					{ title:'客户分析', icon:'icon-kehu', route:'/pages/finance/customerAnalysis' },
					{ title:'联创分析', icon:'icon-gudongxitong', route:'/pages/finance/shareholderAnalysis' }
				]
			}
		},
		computed: {
			...mapState(['userInfo', 'store'])
		},
	}
</script>

<style lang="scss" scoped>
	.grid-box{
		width: 670rpx;
		margin:20rpx auto;
		margin-bottom: 0;
		background-color:#fff;
		padding: 20rpx;
		border-radius: 10rpx;
		.icon{
			background: linear-gradient(to bottom right,#5fd7ef,#5188ec);
			border-radius:10rpx;
			padding: 6rpx;
			margin-bottom: 10rpx;
		}
	}
	
</style>